import { s_getcommontableinfo, s_updateInfo } from "@/services/basis";
import { SwitcherFilled } from "@ant-design/icons";
import { LabelIconTip, ProCard, ProForm, ProFormCheckbox, ProFormDigit, ProFormInstance, ProFormRadio, ProFormSelect, ProFormText } from "@ant-design/pro-components";
import { useRequest } from "@umijs/max";
import { Button, Col, Divider, message, Row, Space, Tabs, TabsProps } from "antd";
import { useEffect, useRef } from "react";

const App:React.FC=()=>{
    const formref_code=useRef<ProFormInstance>();
    const formref_order=useRef<ProFormInstance>();
    const formref_inquiry=useRef<ProFormInstance>();
    const formref_price=useRef<ProFormInstance>();
    const formref_other=useRef<ProFormInstance>();

    //载入时，读取系统设置项--编码规则
    useRequest(async ()=>await s_getcommontableinfo({source:'sys_coderule',x_id:1,id:0}),{
        onSuccess:(data)=>{
            // alert(JSON.stringify(data[0]));
            const t_order=data[0][0];
            const t_inquiry=data[0][1];
            const t_material=data[0][2];
            const t_vendor=data[0][3];
            const t_custom=data[0][4];

            formref_code.current?.setFieldsValue({
                // 采购单
                order_prefix:t_order.prefix,order_suffix:t_order.suffix,order_sn:t_order.sn_width,order_byhand:t_order.byhand,
                order_level1:t_order.level1,order_level2:t_order.level2,
                order_level3:t_order.level3,order_level4:t_order.level4,
                // 询价单
                inquiry_prefix:t_inquiry.prefix,inquiry_suffix:t_inquiry.suffix,inquiry_sn:t_inquiry.sn_width,inquiry_byhand:t_inquiry.byhand,
                inquiry_level1:t_inquiry.level1,inquiry_level2:t_inquiry.level2,
                inquiry_level3:t_inquiry.level3,inquiry_level4:t_inquiry.level4,
                //物料编码
                material_prefix:t_material.prefix,material_suffix:t_material.suffix,material_sn:t_material.sn_width,material_byhand:t_material.byhand,
                material_level1:t_material.level1,material_level1_width:t_material.level1_width,
                material_level2:t_material.level2,material_level2_width:t_material.level2_width,
                material_level3:t_material.level3,material_level3_width:t_material.level3_width,
                material_level4:t_material.level4,material_level4_width:t_material.level4_width,
                //供应商编码
                vendor_prefix:t_vendor.prefix,vendor_suffix:t_vendor.suffix,vendor_sn:t_vendor.sn_width,vendor_byhand:t_vendor.byhand,
                vendor_level1:t_vendor.level1,vendor_level1_width:t_vendor.level1_width,
                vendor_level2:t_vendor.level2,vendor_level2_width:t_vendor.level2_width,
                vendor_level3:t_vendor.level3,vendor_level3_width:t_vendor.level3_width,
                vendor_level4:t_vendor.level4,vendor_level4_width:t_vendor.level4_width,
                //客户编码
                custom_prefix:t_custom.prefix,custom_suffix:t_custom.suffix,custom_sn:t_custom.sn_width,custom_byhand:t_custom.byhand,
                custom_level1:t_custom.level1,custom_level1_width:t_custom.level1_width,
                custom_level2:t_custom.level2,custom_level2_width:t_custom.level2_width,
                custom_level3:t_custom.level3,custom_level3_width:t_custom.level3_width,
                custom_level4:t_custom.level4,custom_level4_width:t_custom.level4_width,
            });
            
        }
    });

    // 切换页签时，读取数据
    async function getParams(item:string){
       if(item=='code'){
            const x=await s_getcommontableinfo({source:'sys_coderule',x_id:1,id:0});
            // alert(JSON.stringify(x.data[0]));
            const t_order=x.data[0][0];
            const t_inquiry=x.data[0][1];
            const t_material=x.data[0][2];
            const t_vendor=x.data[0][3];
            const t_custom=x.data[0][4];

            formref_code.current?.setFieldsValue({
                // 采购单
                order_prefix:t_order.prefix,order_suffix:t_order.suffix,order_sn:t_order.sn_width,order_byhand:t_order.byhand,
                order_level1:t_order.level1,order_level2:t_order.level2,
                order_level3:t_order.level3,order_level4:t_order.level4,
                // 询价单
                inquiry_prefix:t_inquiry.prefix,inquiry_suffix:t_inquiry.suffix,inquiry_sn:t_inquiry.sn_width,inquiry_byhand:t_inquiry.byhand,
                inquiry_level1:t_inquiry.level1,inquiry_level2:t_inquiry.level2,
                inquiry_level3:t_inquiry.level3,inquiry_level4:t_inquiry.level4,
                //物料编码
                material_prefix:t_material.prefix,material_suffix:t_material.suffix,material_sn:t_material.sn_width,material_byhand:t_material.byhand,
                material_level1:t_material.level1,material_level1_width:t_material.level1_width,
                material_level2:t_material.level2,material_level2_width:t_material.level2_width,
                material_level3:t_material.level3,material_level3_width:t_material.level3_width,
                material_level4:t_material.level4,material_level4_width:t_material.level4_width,
                //供应商编码
                vendor_prefix:t_vendor.prefix,vendor_suffix:t_vendor.suffix,vendor_sn:t_vendor.sn_width,vendor_byhand:t_vendor.byhand,
                vendor_level1:t_vendor.level1,vendor_level1_width:t_vendor.level1_width,
                vendor_level2:t_vendor.level2,vendor_level2_width:t_vendor.level2_width,
                vendor_level3:t_vendor.level3,vendor_level3_width:t_vendor.level3_width,
                vendor_level4:t_vendor.level4,vendor_level4_width:t_vendor.level4_width,
                //客户编码
                custom_prefix:t_custom.prefix,custom_suffix:t_custom.suffix,custom_sn:t_custom.sn_width,custom_byhand:t_custom.byhand,
                custom_level1:t_custom.level1,custom_level1_width:t_custom.level1_width,
                custom_level2:t_custom.level2,custom_level2_width:t_custom.level2_width,
                custom_level3:t_custom.level3,custom_level3_width:t_custom.level3_width,
                custom_level4:t_custom.level4,custom_level4_width:t_custom.level4_width,
               
            });

        }else{
        const x=await s_getcommontableinfo({source:'sys_params',x_id:1,id:0,fdata:{item}});
        // alert(JSON.stringify(x.data[0]));
        switch(item){
           case 'price':
                const x1=x.data[0];
                var x10:any=new Object();
                x1.map((item:any)=>{
                    switch(item.param){
                        case 'price_verify': x10.price_verify=item.value;break;
                        case 'price_toorder': x10.price_toorder=item.value;break;
                        case 'price_unorder': x10.price_unorder=item.value;break;
                        case 'price_notice': x10.price_notice=item.value;break;
                        case 'price_byhand': x10.price_byhand=item.value;break;
                        case 'price_doverify': x10.price_doverify=item.value;break;
                    }
                });
                // alert(JSON.stringify(x10));
                formref_price.current?.setFieldsValue({...x10});
                 break;
           case 'inquiry':
                const x2=x.data[0];
                var x20:any=new Object();
                x2.map((item:any)=>{
                switch(item.param){
                   case 'inquiry_verify':x20.inquiry_verify=item.value;break;
                   case 'inquiry_commit':x20.inquiry_commit=item.value;break;
                   case 'inquiry_uncommit':x20.inquiry_uncommit=item.value;break;
                   case 'inquiry_lowervendor':x20.inquiry_lowervendor=item.value;break;
                   case 'inquiry_notice':x20.inquiry_notice=item.value;break;
                   case 'inquiry_autoclose':x20.inquiry_autoclose=item.value;break;
                   case 'inquiry_suit':x20.inquiry_suit=item.value;break;
                 };
                 })
                formref_inquiry.current?.setFieldsValue({...x20});
                break;
           case 'order':
                const x3=x.data[0];
                var x30:any=new Object();
                x3.map((item:any)=>{
                    switch(item.param){
                        case 'order_price':x30.order_price=item.value;break;
                        case 'order_verify':x30.order_verify=item.value;break;
                        case 'order_editprice':x30.order_editprice=item.value;break;
                        case 'order_issue':x30.order_issue=item.value;break;
                        case 'order_unissue':x30.order_unissue=item.value;break;
                    };
                });
                formref_order.current?.setFieldsValue({...x30});
                break;
            case 'other':
                const x4=x.data[0];
                var x40:any=new Object();
                x4.map((item:any)=>{
                    switch(item.param){
                        case 'other_regist2verify':x40.other_regist2verify=item.value;break;
                };
                });
                formref_other.current?.setFieldsValue({...x40});
                break;
        };
    }
    }

   //保存设置
   function save(dtype:number){
      switch(dtype){
        case 0:formref_code.current?.submit();break;
        case 1:formref_inquiry.current?.submit();break;
        case 2:formref_price.current?.submit();break;
        case 3:formref_order.current?.submit();break;
        case 4:formref_other.current?.submit();break;
      }
   };

   async function saveSetting(source:string,x_id:number,operater_id:number,etype:number,fdata:any){
    //   alert(JSON.stringify(fdata));
      const x=await s_updateInfo({source,x_id,operater_id,etype,fdata});
      if(x.success){
        message.success('系统设置保存成功');
      }else
        message.error('保存失败，请联系管理员');
   }

    const sys_code=<>
         <ProCard extra={<Space>
                <Button onClick={()=>save(0)}>保存设置</Button>
           </Space>}
           style={{height:700,overflow:'auto'}}
           >
          <ProForm submitter={false} name="form_code" formRef={formref_code}
            onFinish={()=>saveSetting('sys_coderule',1,1,0,formref_code.current?.getFieldsValue())}
          >
            <Space>
                <Row gutter={8}>
                    <Col span={4}>询价单</Col>
                    <Col span={3}><ProFormText name='inquiry_prefix' label='前缀'/></Col>
                    <Col span={3}><ProFormSelect name='inquiry_level1' label='一级'
                        options={[{value:1,label:'4位年份'},{value:2,label:'2位月份'},{value:3,label:'2位日期'},
                            {value:4,label:'制单人简码'},{value:5,label:'部门简码'}
                        ]}
                    /></Col>
                    <Col span={3}><ProFormSelect name='inquiry_level2' label='二级'
                        options={[{value:1,label:'4位年份'},{value:2,label:'2位月份'},{value:3,label:'2位日期'},
                            {value:4,label:'制单人简码'},{value:5,label:'部门简码'}
                        ]}
                    /></Col>
                    <Col span={3}><ProFormSelect name='inquiry_level3' label='三级'
                        options={[{value:1,label:'4位年份'},{value:2,label:'2位月份'},{value:3,label:'2位日期'},
                            {value:4,label:'制单人简码'},{value:5,label:'部门简码'}
                        ]}
                    /></Col>
                    <Col span={2}><ProFormSelect name='inquiry_level4' label='四级'
                        options={[{value:1,label:'4位年份'},{value:2,label:'2位月份'},{value:3,label:'2位日期'},
                            {value:4,label:'制单人简码'},{value:5,label:'部门简码'}
                        ]}
                    /></Col>
                    <Col span={2}><ProFormText name='inquiry_sn' label='流水号位数'/></Col>
                    <Col span={2}><ProFormText name='inquiry_suffix' label='后缀'/></Col>
                    <Col span={2}><ProFormCheckbox name='inquiry_byhand' label='手工编码'/></Col>
                </Row>
            </Space>
            <Space>
                <Row gutter={8}>
                    <Col span={4}>采购单</Col>
                    <Col span={3}><ProFormText name='order_prefix' label='前缀'/></Col>
                    <Col span={3}><ProFormSelect name='order_level1' label='一级'
                        options={[{value:1,label:'4位年份'},{value:2,label:'2位月份'},{value:3,label:'2位日期'},
                            {value:4,label:'制单人简码'},{value:5,label:'部门简码'}
                        ]}
                    /></Col>
                    <Col span={3}><ProFormSelect name='order_level2' label='二级'
                        options={[{value:1,label:'4位年份'},{value:2,label:'2位月份'},{value:3,label:'2位日期'},
                            {value:4,label:'制单人简码'},{value:5,label:'部门简码'}
                        ]}
                    /></Col>
                    <Col span={3}><ProFormSelect name='order_level3' label='三级'
                        options={[{value:1,label:'4位年份'},{value:2,label:'2位月份'},{value:3,label:'2位日期'},
                            {value:4,label:'制单人简码'},{value:5,label:'部门简码'}
                        ]}
                    /></Col>
                    <Col span={2}><ProFormSelect name='order_level4' label='四级'
                        options={[{value:1,label:'4位年份'},{value:2,label:'2位月份'},{value:3,label:'2位日期'},
                            {value:4,label:'制单人简码'},{value:5,label:'部门简码'}
                        ]}
                    /></Col>
                    <Col span={2}><ProFormText name='order_sn' label='流水号位数'/></Col>
                    <Col span={2}><ProFormText name='order_suffix' label='后缀'/></Col>
                    <Col span={2}><ProFormCheckbox name='order_byhand' label='手工编码'/></Col>
                </Row>
            </Space>
            <Divider>基础数据编码</Divider>
            <Space>
                <Row gutter={8}>
                    <Col span={4}>物料编码</Col>
                    <Col span={3}><ProFormText name='material_prefix' label='前缀'/></Col>
                    <Col span={2}><ProFormSelect name='material_level1' label='一级'
                       options={[{value:1,label:'物料一级分类'},{value:2,label:'物料二级分类'},
                                {value:3,label:'物料三级分类'},{value:4,label:'物料四级分类'},
                                {value:5,label:'物料完整分类'},
                       ]}
                    />
                       <ProFormText name='material_level1_width' label='一级长度' />        
                    </Col>
                    <Col span={2}><ProFormSelect name='material_level2' label='二级'
                       options={[{value:1,label:'物料一级分类'},{value:2,label:'物料二级分类'},
                                {value:3,label:'物料三级分类'},{value:4,label:'物料四级分类'},
                                {value:5,label:'物料完整分类'},
                       ]}
                    />
                       <ProFormText name='material_level2_width' label='二级长度' />        
                    </Col>
                    <Col span={2}><ProFormSelect name='material_level3' label='三级'
                       options={[{value:1,label:'物料一级分类'},{value:2,label:'物料二级分类'},
                                {value:3,label:'物料三级分类'},{value:4,label:'物料四级分类'},
                                {value:5,label:'物料完整分类'},
                       ]}
                    />
                       <ProFormText name='material_level3_width' label='三级长度' />        
                    </Col>
                    <Col span={2}><ProFormSelect name='material_level4' label='四级'
                       options={[{value:1,label:'物料一级分类'},{value:2,label:'物料二级分类'},
                                {value:3,label:'物料三级分类'},{value:4,label:'物料四级分类'},
                                {value:5,label:'物料完整分类'},
                       ]}
                    />
                       <ProFormText name='material_level4_width' label='四级长度' />        
                    </Col>
                    <Col span={3}><ProFormText name='material_sn' label='流水号位数'/></Col>
                    <Col span={3}><ProFormText name='material_suffix' label='后缀'/></Col>
                    <Col span={3}><ProFormCheckbox name='material_byhand' label='手工编码'/></Col>
                </Row>
            </Space>
            <Space>
                <Row gutter={8}>
                    <Col span={4}>客户编码</Col>
                    <Col span={3}><ProFormText name='custom_prefix' label='前缀'/></Col>
                    <Col span={2}><ProFormSelect name='custom_level1' label='一级'
                       options={[{value:1,label:'客户一级分类'},{value:2,label:'客户二级分类'},
                                {value:3,label:'客户三级分类'},{value:4,label:'客户四级分类'},
                                {value:5,label:'客户完整分类'},
                       ]}
                    />
                       <ProFormText name='custom_level1_width' label='一级长度' />        
                    </Col>
                    <Col span={2}><ProFormSelect name='custom_level2' label='二级'
                       options={[{value:1,label:'客户一级分类'},{value:2,label:'客户二级分类'},
                                {value:3,label:'客户三级分类'},{value:4,label:'客户四级分类'},
                                {value:5,label:'客户完整分类'},
                       ]}
                    />
                       <ProFormText name='custom_level2_width' label='二级长度' />        
                    </Col>
                    <Col span={2}><ProFormSelect name='custom_level3' label='三级'
                       options={[{value:1,label:'客户一级分类'},{value:2,label:'客户二级分类'},
                                {value:3,label:'客户三级分类'},{value:4,label:'客户四级分类'},
                                {value:5,label:'客户完整分类'},
                       ]}
                    />
                       <ProFormText name='custom_level3_width' label='三级长度' />        
                    </Col>
                    <Col span={2}><ProFormSelect name='custom_level4' label='四级'
                       options={[{value:1,label:'客户一级分类'},{value:2,label:'客户二级分类'},
                                {value:3,label:'客户三级分类'},{value:4,label:'客户四级分类'},
                                {value:5,label:'客户完整分类'},
                       ]}
                    />
                       <ProFormText name='custom_level4_width' label='四级长度' />        
                    </Col>
                    <Col span={3}><ProFormText name='custom_sn' label='流水号位数'/></Col>
                    <Col span={3}><ProFormText name='custom_suffix' label='后缀'/></Col>
                    <Col span={3}><ProFormCheckbox name='material_byhand' label='手工编码'/></Col>
                </Row>
            </Space>
            <Space>
                <Row gutter={8}>
                    <Col span={4}>供应商编码</Col>
                    <Col span={3}><ProFormText name='vendor_prefix' label='前缀'/></Col>
                    <Col span={2}><ProFormSelect name='vendor_level1' label='一级'
                       options={[{value:1,label:'一级分类'},{value:2,label:'供应商二级分类'},
                                {value:3,label:'供应商三级分类'},{value:4,label:'供应商四级分类'},
                                {value:5,label:'完整分类'},
                       ]}
                    />
                       <ProFormText name='vendor_level1_width' label='一级长度' />        
                    </Col>
                    <Col span={2}><ProFormSelect name='vendor_level2' label='二级'
                       options={[{value:1,label:'供应商一级分类'},{value:2,label:'供应商二级分类'},
                                {value:3,label:'供应商三级分类'},{value:4,label:'供应商四级分类'},
                                {value:5,label:'供应商完整分类'},
                       ]}
                    />
                       <ProFormText name='vendor_level2_width' label='二级长度' />        
                    </Col>
                    <Col span={2}><ProFormSelect name='vendor_level3' label='三级'
                       options={[{value:1,label:'供应商一级分类'},{value:2,label:'供应商二级分类'},
                                {value:3,label:'供应商三级分类'},{value:4,label:'供应商四级分类'},
                                {value:5,label:'供应商完整分类'},
                       ]}
                    />
                       <ProFormText name='vendor_level3_width' label='三级长度' />        
                    </Col>
                    <Col span={2}><ProFormSelect name='vendor_level4' label='四级'
                       options={[{value:1,label:'供应商一级分类'},{value:2,label:'供应商二级分类'},
                                {value:3,label:'供应商三级分类'},{value:4,label:'供应商四级分类'},
                                {value:5,label:'供应商完整分类'},
                       ]}
                    />
                       <ProFormText name='vendor_level4_width' label='四级长度' />        
                    </Col>
                    <Col span={3}><ProFormText name='vendor_sn' label='流水号位数'/></Col>
                    <Col span={3}><ProFormText name='vendor_suffix' label='后缀'/></Col>
                    <Col span={3}><ProFormCheckbox name='vendor_byhand' label='手工编码'/></Col>
                </Row>
            </Space>
            </ProForm>
            </ProCard>
      </>;

      const sys_inquiry=<>
      <ProCard extra={<Space>
        <Button onClick={()=>save(1)}>保存设置</Button>
            </Space>}  style={{height:700,overflow:'auto'}}>
      <ProForm submitter={false} layout="horizontal" formRef={formref_inquiry}
          onFinish={()=>saveSetting('sys_params',1,1,1,formref_inquiry.current?.getFieldsValue())}
         labelAlign="left" labelCol={{span:4,offset:0}} labelWrap>
            <Divider>询价单设置  </Divider> 
            <ProFormRadio.Group name='inquiry_verify' label='是否需要审核' 
              options={[{value:0,label:'不需要'},{value:1,label:'需要'}]}
            />
            <ProFormRadio.Group name='inquiry_commit' label='审核后是否自动下达' 
              options={[{value:0,label:'不自动下达'},{value:1,label:'自动下达'}]}
            />
            <ProFormRadio.Group name='inquiry_uncommit' label='取消审核后是否自动取消下达' 
               options={[{value:0,label:'不取消下达'},{value:1,label:'取消下达'}]}
            />
            
            <ProFormDigit name='inquiry_lowervendor' label='每次最少询价供应商数量' width={200} />
            <ProFormDigit name='inquiry_notice' label='有效期提前提醒天数'  width={200}/>
            <ProFormRadio.Group name='inquiry_autoclose' label='有效到期是否自动关闭' 
                options={[{value:0,label:'不关闭'},{value:1,label:'自动关闭'}]}
            />
            <ProFormSelect name='inquiry_suit' label=' 供应商自动匹配范围' width={200}
              options={[{vlaue:1,label:'正式'},{value:2,label:'观察'},{value:3,label:'临时'},{value:4,label:'全部'}]}
             
            />
      </ProForm>
      </ProCard>
  </>;
  const sys_price=<>
  <ProCard extra={<Space>
    <Button onClick={()=>save(2)}>保存设置</Button>
            </Space>}  style={{height:700,overflow:'auto'}}>
  <ProForm submitter={false} layout="horizontal" formRef={formref_price}
  onFinish={()=>saveSetting('sys_params',1,1,2,formref_price.current?.getFieldsValue())}
      labelAlign="left" labelCol={{span:4,offset:0}} labelWrap>
      
            <ProFormRadio.Group name='price_byhand' label='是否可以手工输入价格表' 
              options={[{value:0,label:'不可以'},{value:1,label:'可以'}]}
            />
            <ProFormRadio.Group name='price_verify' label='核价后是否自动审核价格表' 
              options={[{value:0,label:'不需要'},{value:1,label:'需要'}]}
            />
            <ProFormRadio.Group name='price_toorder' label='核价后是否自动生成采购单' 
               options={[{value:0,label:'不生成'},{value:1,label:'自动生成'}]}
            />
            <ProFormRadio.Group name='price_unorder' label='取消核价后是否自动关闭采购单' 
               options={[{value:0,label:'不关闭'},{value:1,label:'自动关闭'}]}
            />
            <ProFormRadio.Group name='price_doverify' label='价格表是否需要审核才生效' 
               options={[{value:0,label:'不需要'},{value:1,label:'需要审核'}]}
            />
            <ProFormDigit name='price_notice' label='有效期到期，提前提醒天数' width={200}/>
            
   </ProForm>
   </ProCard>
</>;
   const sys_order=<>
   <ProCard extra={<Space>
        <Button onClick={()=>save(3)}>保存设置</Button>
         </Space>}  style={{height:700,overflow:'auto'}}>
        <ProForm labelAlign="left" formRef={formref_order}
        onFinish={()=>saveSetting('sys_params',1,1,3,formref_order.current?.getFieldsValue())}
               labelCol={{span:4,offset:0}}  labelWrap submitter={false}  layout="horizontal"
         >
             <ProFormRadio.Group name='order_price' label='是否强制价格取自价格表' 
                 options={[{value:0,label:'不强制'},{value:1,label:'强制取价格'}]}
             />
             <ProFormRadio.Group name='order_editprice' label='是否可以修改价格'
              options={[{value:0,label:'不可以'},{value:1,label:'可以修改'}]}
             />
             <ProFormRadio.Group name='order_verify' label='是否需要审核' 
              options={[{value:0,label:'不需要'},{value:1,label:'需要审核'}]}
             />
             <ProFormRadio.Group name='order_issue' label='审核后是否自动下达' 
                  options={[{value:0,label:'不下达'},{value:1,label:'自动下达'}]}
             />
             <ProFormRadio.Group name='order_unissue' label='取消审核后是否自动取消下达' 
                  options={[{value:0,label:'不取消'},{value:1,label:'自动取消'}]}
             />
        </ProForm>
        </ProCard>
   </>;

   const sys_other=<>
   <ProCard extra={<Space>
        <Button onClick={()=>save(4)}>保存设置</Button>
         </Space>}  style={{height:700,overflow:'auto'}}>
        <ProForm labelAlign="left" formRef={formref_other}
        onFinish={()=>saveSetting('sys_params',1,1,4,formref_other.current?.getFieldsValue())}
               labelCol={{span:4,offset:0}}  labelWrap submitter={false}  layout="horizontal"
         >
             <ProFormRadio.Group name='other_regist2verify' label='受邀请伙伴提交后，是否自动审核' 
                 options={[{value:0,label:'人工审核'},{value:1,label:'提交即审核'}]}
             />
             以上为临时添加项，待实现
             <ProFormText name='other1' label='订单跟踪物料是否强制不可挪用' />
             <ProFormText name='other2' label='低于安全库存是否提示采购'/>
             各种预警规则，自动运行任务的时间点+简单规则。如自动生成库存预警、采购超期预警等的报表，并发送到相应的工作台；或者工作台手工计算。
        </ProForm>
        </ProCard>
   </>;
const tabsItems:TabsProps['items']=[
    {
        key:'code',
        label:'编码规则',
        children:sys_code,
        
    },
    {
        key:'inquiry',
        label:'询价单设置',
        children:sys_inquiry,
    },
    {
        key:'price',
        label:'价格表设置',
        children:sys_price,
    },
    {
        key:'order',
        label:'采购单设置',
        children:sys_order,
    },
    {
        key:'other',
       label:'其他设置',
       children:sys_other,
    }
];
 
//================================================================================================
return <>
          <Tabs items={tabsItems} onChange={(key)=>getParams(key)}/>
       </>;
}

export default App;